# This is a config file for Koschei that can override values in default
# configuration in /usr/share/koschei/config.cfg. It is a python file expecting
# assignment to config dictionary which will be recursively merged with the
# default one.
config = {
    "database_config": {
        "host": "{{ koschei_pgsql_hostname }}",
        "username": "koscheiuser",
        "password": "{{ koscheiuser_db_password }}",
        "database": "koschei"
    },
    "koji_config": {
        "server": "http://{{ koschei_koji_hub }}/kojihub",
        "topurl": "http://{{ koschei_kojipkgs }}",
        "weburl": "http://{{ koschei_koji_web }}/koji",
        "cert": "/etc/koschei/koschei.pem",
        "ca": "/etc/koschei/fedora-ca.cert",
        "server_ca": "/etc/koschei/fedora-ca.cert",
        "source_tag": "{{ koschei_koji_tag }}",
        "target_tag": "{{ koschei_koji_tag }}",
        "build_tag": "{{ koschei_koji_tag }}-build",
        "max_builds": 40,
        "build_arches": ['i386', 'x86_64', 'armhfp'],
        "build_opts": {
        },
        "load_threshold": 0.65,
        "task_priority": 30,
    },
    "dependency": {
        "build_group": "build",
        "for_arch": "x86_64",
        "repo_cache_items": 10,
        "keep_build_deps_for": 5,
        "local": False,
        "arches": ['x86_64', 'i386'],
        "remote_repo": "http://{{ koschei_kojipkgs }}/repos/{{ koschei_koji_tag }}-build/{repo_id}/{arch}",
        # For upcoming paraller resolver
        "cache_l1_capacity": 8,
        "cache_l2_capacity": 128,
        "cache_l1_threads": 6,
        "cache_l2_threads": 2,
        "cache_threads_max": 8,
        {% if env == 'staging' %}
        "ignore_weak_deps": True,
        {% endif %}
    },
    "services": {
        "watcher": {
            {% if env == 'staging' %}
            "watchdog_interval": None, # there are almost no messages in stg
            {% else %}
            "watchdog_interval": 600, # in seconds
            {% endif %}
        },
        "polling": {
            "interval": 20*60, # in seconds
        },
    },
    "flask": {
        "SECRET_KEY": "{{ koschei_flask_secret_key }}",
    },
    "logging": {
        "loggers": {
            "": {
                "level": "DEBUG",
                "handlers": ["stderr", "email"],
            },
        },
        "handlers": {
            "email": {
                "class": "logging.handlers.SMTPHandler",
                "level": "WARN",
                "mailhost": "localhost",
                "fromaddr": "koschei@fedoraproject.org",
                "toaddrs": ['sysadmin-koschei-members@fedoraproject.org'],
                "subject": "Koschei {{ env }} warning",
            },
        },
    },
    "fedmsg": {
        {% if env == 'staging' %}
        "topic": "org.fedoraproject.stg.buildsys",
        {% else %}
        "topic": "org.fedoraproject.prod.buildsys",
        {% endif %}
    },
    "fedmsg-publisher": {
        "enabled": True,
        "modname": "koschei",
    },
    "pkgdb": {
        {% if env == 'staging' %}
        "pkgdb_url": 'https://admin.stg.fedoraproject.org/pkgdb/api',
        "topic_re": r'\.stg\.pkgdb\.',
        {% else %}
        "pkgdb_url": 'https://admin.fedoraproject.org/pkgdb/api',
        "topic_re": r'\.prod\.pkgdb\.',
        {% endif %}
        "sync_tracked": True,
    },
    "frontend": {
        "auto_tracking": True,
        {% if env == 'staging' %}
        # Staging copies for fedmenu
        "fedmenu_url": "https://apps.stg.fedoraproject.org/fedmenu",
        "fedmenu_data_url": "https://apps.stg.fedoraproject.org/js/data.js",
        {% else %}
        # Production copies for fedmenu
        "fedmenu_url": "https://apps.fedoraproject.org/fedmenu",
        "fedmenu_data_url": "https://apps.fedoraproject.org/js/data.js",
        {% endif %}
    },
    "openid": {
        "openid_provider": "{{ koschei_openid_provider }}",
    },
    "bugreport": {
        "url": "https://{{ koschei_bugzilla }}/enter_bug.cgi?%s",
        "template": {
            "product": "Fedora",
            "component": "{name}",
            "version": "rawhide",
            "short_desc": "{name}: FTBFS in rawhide",
            "bug_file_loc": "{{ koschei_topurl }}/package/{name}",
            "comment": """
            Description of problem:
            Package {name} fails to build from source in rawhide.

            Version-Release number of selected component (if applicable):
            {version}-{release}

            Steps to Reproduce:
            koji build --scratch {{ koschei_koji_tag }} {nvr}.{arch}.rpm

            Additional info:
            This package is tracked by Koschei. See:
            {{ koschei_topurl }}/package/{name}"""
        },
    },
}

# Local Variables:
# mode: Python
# End:
# vi: ft=python
